<?php
class ORMProduceTrack extends ORMBase {
  public function __construct() {
    parent::__construct('ProduceTrack');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->produce_id = isset($object->produce_id) ? $object->produce_id : 0;
    $epObject->parent_trackId = isset($object->parent_trackId) ? $object->parent_trackId : '';
    $epObject->createdDate = (isset($object->createdDate) && $object->createdDate) ? SimpleDate::toStamp($object->createdDate) : 0;
    $epObject->cancelled = isset($object->cancelled) ? $object->cancelled : 0;
    $epObject->completed = isset($object->completed) ? $object->completed : 0;
    $epObject->modified = isset($object->modified) ? $object->modified : 0;
    $epObject->state = isset($object->state) ? $object->state : 0;
    $epObject->deadline = (isset($object->deadline) && $object->deadline) ? SimpleDate::toStamp($object->deadline) : 0;
    $epObject->sentDate = (isset($object->sentDate) && $object->sentDate) ? SimpleDate::toStamp($object->sentDate) : 0;
    $epObject->receivedDate = (isset($object->receivedDate) && $object->receivedDate) ? SimpleDate::toStamp($object->receivedDate) : 0;
    $epObject->receiver = isset($object->receiver) ? $object->receiver : '';
    $epObject->address = isset($object->address) ? $object->address : '';
    $epObject->code = isset($object->code) ? $object->code : '';
    $epObject->company = isset($object->company) ? $object->company : '';
    $epObject->weight = isset($object->weight) ? $object->weight : 0;
    $epObject->comment = isset($object->comment) ? $object->comment : '';
    $epObject->review = isset($object->review) ? $object->review : '';
    $epObject->user_trackId = isset($object->user_trackId) ? $object->user_trackId : '';
    $epObject->user_account = isset($object->user_account) ? $object->user_account : '';
    $epObject->user_password = isset($object->user_password) ? $object->user_password : '';
    $epObject->user_name = isset($object->user_name) ? $object->user_name : '';
    $epObject->user_email = isset($object->user_email) ? $object->user_email : '';
    $epObject->user_type = isset($object->user_type) ? $object->user_type : '';
    $epObject->when = (isset($object->when) && $object->when) ? SimpleDate::toStamp($object->when) : 0;
    $epObject->how = isset($object->how) ? $object->how : '';
    $epObject->date = (isset($object->date) && $object->date) ? SimpleDate::toStamp($object->date) : 0;
    $epObject->userTrackId = isset($object->userTrackId) ? $object->userTrackId : '';
    $epObject->userAccount = isset($object->userAccount) ? $object->userAccount : '';
    $epObject->sourceId = isset($object->sourceId) ? $object->sourceId : 0;
    $epObject->targetId = isset($object->targetId) ? $object->targetId : 0;
    $epObject->extra = isset($object->extra) ? $object->extra : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->produce_id = $epObject->produce_id;
    $object->parent_trackId = $epObject->parent_trackId;
    $object->createdDate = ($epObject->createdDate != 0) ? SimpleDate::fromStamp($epObject->createdDate) : 0;
    $object->cancelled = $epObject->cancelled;
    $object->completed = $epObject->completed;
    $object->modified = $epObject->modified;
    $object->state = $epObject->state;
    $object->deadline = ($epObject->deadline != 0) ? SimpleDate::fromStamp($epObject->deadline) : 0;
    $object->sentDate = ($epObject->sentDate != 0) ? SimpleDate::fromStamp($epObject->sentDate) : 0;
    $object->receivedDate = ($epObject->receivedDate != 0) ? SimpleDate::fromStamp($epObject->receivedDate) : 0;
    $object->receiver = $epObject->receiver;
    $object->address = $epObject->address;
    $object->code = $epObject->code;
    $object->company = $epObject->company;
    $object->weight = $epObject->weight;
    $object->comment = $epObject->comment;
    $object->review = $epObject->review;
    $object->user_trackId = $epObject->user_trackId;
    $object->user_account = $epObject->user_account;
    $object->user_password = $epObject->user_password;
    $object->user_name = $epObject->user_name;
    $object->user_email = $epObject->user_email;
    $object->user_type = $epObject->user_type;
    $object->when = ($epObject->when != 0) ? SimpleDate::fromStamp($epObject->when) : 0;
    $object->how = $epObject->how;
    $object->date = ($epObject->date != 0) ? SimpleDate::fromStamp($epObject->date) : 0;
    $object->userTrackId = $epObject->userTrackId;
    $object->userAccount = $epObject->userAccount;
    $object->sourceId = $epObject->sourceId;
    $object->targetId = $epObject->targetId;
    $object->extra = $epObject->extra;
    return $object;
  }
}
?>
